package com.hxzy.apsect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author wzm
 * @create 2024-03-12 14:36
 * project_name:JavaWeb2401
 * @Description
 */
//@Component
//@Aspect
public class Aspect02 {

    //用@annoation注解来作为切入点表达式
    @Pointcut("@annotation(com.hxzy.annoation.MyLog)") //只要添加了MyLog的方法就会被增强
    public void pt1(){}




    //引用某个切面类中定义切入点表达式 TimeAspect类中的切入点表达式
    //使用全类名
    @Before("pt1()")
    public void before(){
        System.out.println("before88888888888888888888888");
    }


    @After("pt1()")
    public void after(){
        System.out.println("after888888888888888888888888");
    }
}

